Skip to content

fix(tools): reject non-positive topic receive/image/TF timeouts - #827

Closed
Bartok9 wants to merge 1 commit into
RobotecAI:mainfrom
Bartok9:aerial/receive-image-timeout-positive
Closed

fix(tools): reject non-positive topic receive/image/TF timeouts#827
Bartok9 wants to merge 1 commit into
RobotecAI:mainfrom
Bartok9:aerial/receive-image-timeout-positive

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Agent-supplied timeout_sec on receive/image/TF tools can be 0/negative/bool/NaN.
Adds require_positive_timeout and wires it into ReceiveROS2MessageTool, GetROS2ImageTool, GetROS2TransformTool.

Testing

  • Offline unit tests where ROS not required (uv pytest)
  • AI-assisted; human-reviewed

Claim: bartok
Operator: bartok
Campaign: aerial-drone

Add require_positive_timeout helper and use it in ReceiveROS2MessageTool,
GetROS2ImageTool, and GetROS2TransformTool so agent-provided timeouts cannot
be zero, negative, boolean, or NaN. Offline unit tests cover the helper.

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
@maciejmajek

Copy link
Copy Markdown
Member

Took this in #872, though as gt=0 on the timeout_sec fields in the args_schema rather than a helper in _run. Pydantic rejects the call before it reaches us and the constraint lands in the tool schema the model sees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants